<!--
 * @页面名称:顶部按钮事件
 * @描述: 
 * @作者: 
 * @Date:
-->
<template>
  <el-row style="flex: 1" justify="space-between" align="middle">
    <!-- <el-row justify="space-between" align="middle" class="barOptions"> -->
    <el-col :span="20">
      <!-- <el-scrollbar> -->
      <div class="header-button-lf" v-if="buttonPermission.length > 0 && !userStore.userInfo.U_ReadOnly">
        <el-tooltip
          class="box-item"
          effect="dark"
          :content="item.title"
          placement="top"
          v-for="item in buttonPermission.filter((v:any) => !v.list)"
          :key="item"
        >
          <el-button
            v-if="!item.iconfontIcon"
            :icon="item.icon === 'QrcodeOutlined' ? QrcodeOutlined : item.icon"
            :disabled="toggleDisabled(item)"
            circle
            @click="onClickVerb1(item.alias)"
          />
          <el-button v-else :disabled="toggleDisabled(item)" circle @click="onClickVerb1(item.alias)">
            <i :class="`iconfont ${item.iconfontIcon} customfont`"></i>
          </el-button>
        </el-tooltip>
        <!-- 常用操作 -->
        <el-space style="margin-left: 10px">
          <template v-for="(item,index) in buttonPermission.filter((v:any)=>v.list)">
            <el-dropdown v-if="item.list.length > 0" :key="index">
              <el-button v-if="item.iconfontIcon"> <i :class="`iconfont ${item.iconfontIcon}`"></i> {{ item.title }} </el-button>
              <el-button v-if="item.icon !== 'QrcodeOutlined' && !item.iconfontIcon" :icon="item.icon">
                {{ item.title }}
              </el-button>
              <el-button v-else :icon="QrcodeOutlined"> {{ item.title }} </el-button>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item
                    v-for="item2 in item.list"
                    :disabled="toggleDisabled(item2)"
                    :v-show="item2.show"
                    :key="item2.alias"
                    @click="onClickVerb1(item2.alias)"
                  >
                    <i v-if="item2?.iconfontIcon" :class="`iconfont ${item2?.iconfontIcon} customIcon`"></i>
                    <template v-else>
                      <el-icon v-if="item.icon !== 'QrcodeOutlined'">
                        <component :is="item2.icon"></component>
                      </el-icon>
                      <el-icon v-else>
                        <component :is="QrcodeOutlined"></component>
                      </el-icon>
                    </template>
                    {{ item2.title }}
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
          </template>
        </el-space>
        <!-- 报表 -->
        <div>
          <el-dropdown>
            <el-button icon="TrendCharts" class="records-btn"> 报表 </el-button>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item v-for="item in reportData" :key="item.RM_ID" @click="downloadExcel(item)">
                  <!-- <el-icon><Message /></el-icon> -->
                  <i class="iconfont icon-xiazaibaobiao"></i>
                  {{ item.RM_FileName }}
                </el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
        </div>
      </div>
      <!-- </el-scrollbar> -->
    </el-col>
    <!-- <el-col :span="4" v-if="type !== 'childButton'">
      <div class="header-button-rg">
        <el-button :icon="isView ? 'View' : 'Hide'" circle @click="toggle" />
      </div>
    </el-col> -->
    <!-- <div class="header-button-rg" v-if="type !== 'childButton'">
      <el-button :icon="isView ? 'View' : 'Hide'" circle @click="toggle" />
    </div> -->
  </el-row>
  <input ref="filElem" type="file" accept=".xlsx" @change="uploadFile2" style="display: none" />
</template>

<script setup lang="ts">
import { ref, computed } from "vue";
import { View, Hide } from "@element-plus/icons-vue";
// import { QrcodeOutlined } from "@ant-design/icons-vue";
import { QrcodeOutlined } from "@ant-design/icons-vue";
import { useDynamicButtonStore } from "@/stores/modules/dynamicButton";
import { useDynamicStore } from "@/stores/modules/dynamic";
import { useCatalogStore } from "@/stores/modules/catalog";
import { useUserStore } from "@/stores/modules/user";
// import { downloadExcel } from "@/utils/webUpload";
import useCurrentInstance from "@/utils/useCurrentInstance";
import { getSysConfig } from "@/utils/util";
import { useRoute } from "vue-router";
import { TableSelect } from "vxe-pc-ui";
import { isStatusOneOrTwelve, isStatusElevenOrTwentyOne } from "@/utils/statusCheck";

const props = defineProps({
  type: {
    type: String,
    default: () => {
      return "";
    }
  },
  reportData: {
    type: Array as any,
    default: () => {
      return [];
    }
  }
});
const userStore = useUserStore();
const dynamicButton = useDynamicButtonStore();
const dynamicStore = useDynamicStore();
const catalogStore = useCatalogStore();
const emit = defineEmits(["buttonClick", "exportExcel", "reportExcel", "trigger"]);
const { proxy } = useCurrentInstance();
// 上传表格实例
const filElem = ref();
// 小眼睛的状态
const isView = ref(false);
const route = useRoute();
// 主表按钮点击事件
const onClickVerb1 = (val: string) => {
  if (val === "Excel导入") {
    // 检查Excel导入权限
    let hasImportPermission = false;

    // 判断是否是通过父表进入的子表
    if (route.query.fatherObj && !dynamicStore.childLeftClick && !dynamicStore.noCatalogStatus) {
      const fatherObj = JSON.parse(decodeURIComponent(route.query.fatherObj as any));
      if (fatherObj.Catalog_ID) {
        const catalogItem = catalogStore.catalogList.find((v: any) => v.Catalog_ID === fatherObj.Catalog_ID);
        if (catalogItem && catalogItem.PC_PermissionStr) {
          const permissionStr = JSON.parse(catalogItem.PC_PermissionStr);
          hasImportPermission = permissionStr[0] && permissionStr[0].includes("导入");
        }
      }
    } else {
      // 检查当前节点的权限
      if (catalogStore.treeNode && catalogStore.treeNode.PC_PermissionStr) {
        const permissionStr = JSON.parse(catalogStore.treeNode.PC_PermissionStr);
        hasImportPermission = permissionStr[0] && permissionStr[0].includes("导入");
      }
    }

    if (!hasImportPermission) {
      proxy.$message.warning("暂无上传权限");
      return;
    }

    filElem.value?.click();
  } else {
    emit("buttonClick", val);
  }
};
// Excel文件导入点击触发按钮
const uploadFile2 = () => {
  const files = filElem.value?.files;
  if (!/\.(xlsx)$/.test(files[0].name.toLowerCase())) {
    proxy.$warning({
      title: "提示",
      content: "上传格式不正确，请上传xlsx格式"
    });
    return false;
  }
  emit("exportExcel", files);
  filElem.value.value = null; // 上传后置空操作,解决同一
  // 文件不能连续上传两次bug(不可缺少)
};
// 下载报表
const downloadExcel = (data: any) => {
  emit("reportExcel", data);
};
// 获取按钮权限
const buttonPermission = computed(() => {
  let Permission = [];
  switch (props.type) {
    case "parentButton":
      Permission = dynamicButton.buttonList;
      break;
    case "childButton":
      Permission = dynamicButton.childButtonList;
      break;
    default:
      break;
  }
  return Permission;
});
// 点击切换搜索表单的显示隐藏
const toggle = () => {
  isView.value = !isView.value;
  emit("trigger");
};
// 按钮状态
const toggleDisabled = (val: any) => {
  let ParenObj = route.query?.fatherObj ? JSON.parse(decodeURIComponent(route.query?.fatherObj as any)) : {};
  //
  const isCanAdd = getSysConfig("parentNodeCanAdd");
  if (props.type === "parentButton") {
    if (val.alias === "新增") {
      // 判断是否是通过父表进入的子表
      if (route.query.fatherObj && !dynamicStore.childLeftClick && !dynamicStore.noCatalogStatus) {
        if (!isStatusOneOrTwelve(ParenObj?.Status) && route.query.status == "Collect") {
          return (val.disabled = true);
        } else {
          const CatalogID = ParenObj.Catalog_ID;
          console.log(CatalogID);
          // 判断是否存在CatalogID
          if (CatalogID) {
            const PermissionStr = JSON.parse(
              catalogStore.catalogList.filter((v: any) => v.Catalog_ID === CatalogID)[0].PC_PermissionStr
            );
            if (!PermissionStr[0].includes("新增")) {
              return (val.disabled = true);
            }
          }
        }
      } else {
        if (isCanAdd !== "1" && catalogStore.treeNode?.children) {
          //配制了叶子结点新，再判断是否是叶子结点
          return (val.disabled = true);
        }
      }
      // if (dynamicStore.tableSelect.length > 0) {
      //   return (val.disabled = true);
      // }
    }
    if (val.alias === "修改") {
      if (
        dynamicStore.tableSelect.length <= 0 ||
        dynamicStore.tableSelect[0]?.IsLock ||
        [11, 21].includes(dynamicStore.tableSelect[0]?.Status) ||
        (route.query.status !== "Arrangement" && [2].includes(dynamicStore.tableSelect[0]?.Status)) ||
        (route.query.status !== "Storage" && [3].includes(dynamicStore.tableSelect[0]?.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "删除") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (
        dynamicStore.tableSelect.length <= 0 ||
        !dynamicStore.tableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.tableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status)) ||
        (route.query.status !== "Storage" && [3].includes(dynamicStore.tableSelect[0]?.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "克隆") {
      if (route.query.fatherObj && !dynamicStore.childLeftClick && !dynamicStore.noCatalogStatus) {
        if (!isStatusOneOrTwelve(ParenObj?.Status) && route.query.status == "Collect") {
          return (val.disabled = true);
        }
      }
      if (dynamicStore.tableSelect.length <= 0 || (isCanAdd !== "1" && catalogStore.treeNode?.children)) {
        //配制了叶子结点新，再判断是否是叶子结点
        return (val.disabled = true);
      }
    }
    if (val.alias === "复制") {
      if (dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "粘贴") {
      if (route.query.fatherObj && !dynamicStore.childLeftClick && !dynamicStore.noCatalogStatus) {
        if (!isStatusOneOrTwelve(ParenObj?.Status) && route.query.status == "Collect") {
          return (val.disabled = true);
        }
      }
      if (isCanAdd !== "1" && catalogStore.treeNode?.children) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "剪贴") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (
        dynamicStore.tableSelect.length <= 0 ||
        !dynamicStore.tableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.tableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "修改分类") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (
        dynamicStore.tableSelect.length <= 0 ||
        !dynamicStore.tableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.tableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "流水操作" || val.alias === "小流水操作") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      // if (![1, 12].includes(ParenObj?.Status) && route.query.status == "Collect") {
      //   return (val.disabled = true);
      // }
      if (
        dynamicStore.tableSelect.length <= 0 ||
        !dynamicStore.tableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.tableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (
      ["轨迹查看", "权限管理", "前端导出", "导出归档登记表", "导出归档目录清单", "打包", "打包下载全文", "数据二维码"].includes(
        val.alias
      )
    ) {
      if (dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (["离线挂接", "批量挂接全文"].includes(val.alias)) {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (["标记备注", "查找替换"].includes(val.alias)) {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "文件锁定") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (dynamicStore.tableSelect.length <= 0 || !dynamicStore.tableSelect.every(item => item.IsLock !== true)) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "文件解锁") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (!isStatusOneOrTwelve(ParenObj?.Status) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      // console.log(dynamicStore.tableSelect.length <= 0, !dynamicStore.tableSelect.every(item => item.IsLock === true));

      if (dynamicStore.tableSelect.length <= 0 || !dynamicStore.tableSelect.every(item => item.IsLock === true)) {
        return (val.disabled = true);
      }
    }
    if ("合卷" === val.alias) {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }

      const filterData2 = dynamicStore.tableSelect.filter((v: any) => v.Parent_ID !== null || v.Parent_ID !== "");
      if (dynamicStore.tableSelect.every(item => item.Parent_ID)) {
        return (val.disabled = true);
      }
    }
    if ("拆卷" === val.alias) {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      // const filterData2 = dynamicStore.tableSelect.every(item => item.Parent_ID);
      if (dynamicStore.tableSelect.every(item => !item.Parent_ID)) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "查询归卷") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
      // 判断选中的数据中是否有父级ID，表示选中的数据都是没有归档的
      // const filterData2 = dynamicStore.tableSelect.filter((v: any) => v.Parent_ID !== null || v.Parent_ID !== "");
      // if (filterData2.length > 0) {
      //   return (val.disabled = true);
      // }
    }
    if (val.alias === "数据提交") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "数据撤回") {
      const filterData = dynamicStore.tableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.tableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
  } else {
    if (val.alias === "新增") {
      // 判断是否是通过父表进入的子表
      if (!isStatusOneOrTwelve(dynamicStore.tableSelect[0]?.Status) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
    }
    if (val.alias === "修改") {
      if (
        dynamicStore.childTableSelect.length <= 0 ||
        dynamicStore.childTableSelect[0].IsLock ||
        [11, 21].includes(dynamicStore.childTableSelect[0].Status) ||
        (route.query.status !== "Storage" && [3].includes(dynamicStore.childTableSelect[0].Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "删除") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (
        dynamicStore.childTableSelect.length <= 0 ||
        !dynamicStore.childTableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.childTableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status)) ||
        (route.query.status !== "Storage" && [3].includes(dynamicStore.childTableSelect[0].Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "克隆") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "复制") {
      if (dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "粘贴") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (isCanAdd !== "1" && catalogStore.treeNode?.children) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "剪贴") {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (
        dynamicStore.childTableSelect.length <= 0 ||
        !dynamicStore.childTableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.childTableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "修改分类") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (
        dynamicStore.childTableSelect.length <= 0 ||
        !dynamicStore.childTableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.childTableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "流水操作" || val.alias === "小流水操作") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (
        dynamicStore.childTableSelect.length <= 0 ||
        !dynamicStore.childTableSelect.every(item => item.IsLock !== true) ||
        !dynamicStore.childTableSelect.every(item => !isStatusElevenOrTwentyOne(item.Status))
      ) {
        return (val.disabled = true);
      }
    }
    if (
      ["轨迹查看", "权限管理", "前端导出", "导出归档登记表", "导出归档目录清单", "打包", "打包下载全文", "数据二维码"].includes(
        val.alias
      )
    ) {
      if (dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (["离线挂接", "批量挂接全文"].includes(val.alias)) {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (["标记备注", "查找替换"].includes(val.alias)) {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "文件锁定") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      if (dynamicStore.childTableSelect.length <= 0 || !dynamicStore.childTableSelect.every(item => item.IsLock !== true)) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "文件解锁") {
      if (dynamicStore.childTableSelect.every(item => !isStatusOneOrTwelve(item.Status)) && route.query.status == "Collect") {
        return (val.disabled = true);
      }
      console.log(dynamicStore.childTableSelect.length <= 0, !dynamicStore.childTableSelect.every(item => item.IsLock === true));
      if (dynamicStore.childTableSelect.length <= 0 || !dynamicStore.childTableSelect.every(item => item.IsLock === true)) {
        return (val.disabled = true);
      }
    }
    if ("合卷" === val.alias) {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
      if (dynamicStore.childTableSelect.every(item => item.Parent_ID)) {
        return (val.disabled = true);
      }
    }
    if ("拆卷" === val.alias) {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
      // const filterData2 = dynamicStore.childTableSelect.every(item => item.Parent_ID);
      if (dynamicStore.childTableSelect.every(item => !item.Parent_ID)) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "查询归卷") {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
      // 判断选中的数据中是否有父级ID，表示选中的数据都是没有归档的
      // const filterData2 = dynamicStore.childTableSelect.filter((v: any) => v.Parent_ID !== null || v.Parent_ID !== "");
      // if (filterData2.length > 0) {
      //   return (val.disabled = true);
      // }
    }
    if (val.alias === "数据提交") {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
    if (val.alias === "数据撤回") {
      const filterData = dynamicStore.childTableSelect.filter((v: any) => v.Status != 1 && v.Status != 12);
      if ((filterData.length > 0 && route.query.status == "Collect") || dynamicStore.childTableSelect.length <= 0) {
        return (val.disabled = true);
      }
    }
  }
};
</script>

<style scoped lang="scss">
.barOptions {
  .header-button-lf {
    display: flex;
    .box-item {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: center;
      width: 100px;
      height: 50px;
      margin: 10px;
      text-align: center;
      border-radius: 4px;
    }
  }
  .header-button-rg {
    display: flex;
    justify-content: flex-end;
  }
}
.customIcon {
  font-size: 15px;
}
.customfont {
  font-size: 14px;
}
.icon-daochumuluqingdan {
  font-size: 18px;
}
.icon-qiyeshujuliucheng {
  margin-right: 4px;
  font-size: 14px;
}
.icon-erweima1688 {
  font-size: 14px;
}
</style>
